﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Travel.MVC
{
    /// <summary>
    /// 支持主题的视图引擎
    /// </summary>
    public class ThemeViewEngine : RazorViewEngine
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ThemeViewEngine"/> class.
        /// </summary>
        /// <param name="themeName">主题名称</param>
        public ThemeViewEngine()
        {

            var locationFormats = new[]
            {
                "~/Views/{0}.cshtml",
                "~/Views/{1}/{0}.cshtml",
                "~/Views/Shared/{0}.cshtml",
                 
            };

            MasterLocationFormats = locationFormats;
            ViewLocationFormats = locationFormats;
            PartialViewLocationFormats = locationFormats;
            FileExtensions = new string[] { "cshtml" };
        }
    }
}